The ultimate documentation for source code is the source code itself. Therefore, it is important that source code be formatted to be human readable. This has led to the development of formatting standards that specify how programmers are to format the source code. However, programmers frequently do not write source code that complies with these formatting standards. This has led to the development of tools for evaluating whether source code complies with the formatting standards and for reformatting the source code to produce source code that does comply. One of the problems in evaluating and reformatting source code is the existence of simple statements that should be reformatted into compound statements to enhance readability.
Transforming a simple statement into a compound statement involves transforming a single line of source code into multiple lines of source code, associating levels of indentation with each of the multiple lines of source code, and inserting begin and end block indicators, such as DO END pairs or left and right brackets. Transforming a simple statement into a compound statement makes the code much easier for a human to read and comprehend. The transformation, however, should not change the functionality of the code. That is, the compound statement should have the same functionality as the simple statement.
To the best of applicant's knowledge, prior art reformatters do not have the ability to automatically reformat simple statements into compound statements. Therefore, a need exists for such a capability.